﻿using LazyLib.Wow;
using LazyLib.Combat;

namespace Frosty.Helpers
{
    public class Functions
    {
        public static string IsSkinnableYesNo(PUnit target)
        {
            switch (target.IsSkinnable)
            {
                case true:
                    return "Yes";
                case false:
                    return "False";
            }
            return null;
        }

        public static bool MeleeRange()
        {
            return ObjectManager.MyPlayer.Target.DistanceToSelf <= CombatEngine.MeleeDistance ? true : false;
        }

        /// <summary>
        ///   Does the action.
        /// </summary>
        /// <param name = "action">The action.</param>
        /// <returns></returns>
        public bool DoAction(PAction action)
        {
            if (action.IsWanted)
            {
                action.Execute();
                return true;
            }
            return false;
        }
    }
}
